﻿#include "mycefapp.h"
#include "include/wrapper/cef_helpers.h"
#include "include/views/cef_window.h"
#include "include/cef_browser.h"
#include "include/views/cef_browser_view.h"
#include "windowdelegate.h"
#include "httpschemefactory.h"
CefRefPtr<CefBrowserProcessHandler> MyCefApp::GetBrowserProcessHandler()
{
	return this;
}
void MyCefApp::OnContextInitialized()
{
	CEF_REQUIRE_UI_THREAD();

    CefRegisterSchemeHandlerFactory("https", "afour", new HttpSchemeFactory());
    auto url = "https://afour/index.html?a=123";
    CefBrowserSettings settings;
    CefRefPtr<CefBrowserView> browser_view = CefBrowserView::CreateBrowserView(nullptr, url, settings, nullptr, nullptr, nullptr);
    CefWindow::CreateTopLevelWindow(new WindowDelegate(browser_view));
}